package com.book.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.book.service.OrderService;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/order")
public class OrderController {
	@Autowired
	private OrderService orderService;
	
	//购买图书
	@RequestMapping("/buy/{id}")
	public String buy(@PathVariable(value="id") Integer id) throws Exception {
		orderService.buy(id);
		return "success";
	}
}
